package com.jxb.test20241216;

import com.jxb.first.ListNode;

public class ReverseLinkedList_206 {

    public static void main(String[] args) {

    }


    public ListNode reverseList(ListNode head) {
        ListNode pre = null;
        ListNode currentP = head;
        while (currentP != null) {
            currentP.next = pre;
            pre = currentP;
            currentP = currentP.next;
        }
        return pre;
    }



}
